// @JUDGE_ID:  1000AA  100  Java  "Easy algorithm"
import java.io.IOException;
import java.util.StringTokenizer;

class Main
{
    static String ReadLn(int maxLg) // utility function to read from stdin
    {
        byte lin[] = new byte[maxLg];
        int lg = 0, car = -1;
        try
        {
            while (lg < maxLg)
            {
                car = System.in.read();
                if ((car < 0) || (car == '\n'))
                    break;
                lin[lg++] += car;
            }
        }
        catch (IOException e)
        {
            return (null);
        }

        if ((car < 0) && (lg == 0))
            return (null); // eof
        return (new String(lin, 0, lg));
    }

    public static void main(String args[]) // entry point from OS
    {
        Main myWork = new Main(); // create a dinamic instance
        myWork.Begin(); // the true entry point
    }

    void Begin()
    {
        String input;
        StringTokenizer idata;
        int a, b;

        ThreeNPlusOne threeNPlusOne = new ThreeNPlusOne();
        while ((input = Main.ReadLn(255)) != null)
        {
            idata = new StringTokenizer(input);
            a = Integer.parseInt(idata.nextToken());
            b = Integer.parseInt(idata.nextToken());

            System.out.println(a + " " + b + " " + threeNPlusOne.longestSequenceLength(a, b));
        }
    }

}

class ThreeNPlusOne
{
    public int longestSequenceLength(int i, int j)
    {
        int longest = 0;
        int min, max;
        if (i < j)
        {
            min = i;
            max = j;
        }
        else
        {
            min = j;
            max = i;
        }
        while (min <= max)
        {
            int sequenceLength = sequenceLength(min++);
            if (sequenceLength > longest)
            {
                longest = sequenceLength;
            }
        }
        return longest;
    }

    private int sequenceLength(int i)
    {
        int length = 1;
        long result = i;

        while (result != 1)
        {
            length++;
            if (result % 2 == 0)
            {
                result >>= 1;
            }
            else
            {
                result = 3 * result + 1;
            }
        }
        return length;
    }
}